package cn.gzjp.modules.logis.service;

import cn.gzjp.common.persistence.Page;
import cn.gzjp.common.service.CrudService;
import cn.gzjp.modules.logis.dao.LogisUserDao;
import cn.gzjp.modules.logis.dao.LogisUserUnionDao;
import cn.gzjp.modules.logis.entity.LogisUser;
import cn.gzjp.modules.logis.entity.LogisUserUnion;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 统一用户Service
 * @author zengcp
 * @version 2018-03-21
 */
@Service
@Transactional(readOnly = true)
public class LogisUserUnionService extends CrudService<LogisUserUnionDao, LogisUserUnion> {

	public LogisUserUnion get(String id) {
		return super.get(id);
	}
	
	public List<LogisUserUnion> findList(LogisUserUnion logisUser) {
		return super.findList(logisUser);
	}
	
	public Page<LogisUserUnion> findPage(Page<LogisUserUnion> page, LogisUserUnion logisUser) {
		return super.findPage(page, logisUser);
	}
	

	@Transactional(readOnly = false)
	public void save(LogisUserUnion logisUser) {
		LogisUserUnion m = get(logisUser.getId());
		if(m!=null){
			super.save(logisUser);
		}else{
			super.insert(logisUser, logisUser.getId());
		}
	}
	
	@Transactional(readOnly = false)
	public void delete(LogisUserUnion logisUser) {
		super.deleteByLogic(logisUser);
	}
	
}